import logging
import yagmail

def log():
    log = logging.basicConfig(level=logging.DEBUG,
                        filename='log.txt',
                        filemode='w+',
                        format='%(levelname)s %(filename)s %(message)s %(asctime)s %(lineno)d')
    return log

def email():
    mail = yagmail.SMTP(user="3409851406@qq.com",password="uyziigxnldbpdbga",host='smtp.qq.com')
    mail.send(to='3409851406@qq.com',subject='测试报告',contents='log.txt')


